package day015.set;

import java.util.TreeSet;

public class TreeSetDemo3 {
    public static void main(String[] args) {
        TreeSet<Teacher> ts = new TreeSet<>(new ComaratorImpl());

        Teacher t1 = new Teacher("dilireba", 19);
        Teacher t2 = new Teacher("gulinazha", 20);
        Teacher t3 = new Teacher("maerzhaha", 18);
        Teacher t4 = new Teacher("ouyangnana", 18);

        ts.add(t1);
        ts.add(t2);
        ts.add(t3);
        ts.add(t4);

        System.out.println(ts);
    }
}
